/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { commonVariable } from './CommonClassFile';
import { MandreelDocument } from './MandreelDocument';

class MandreelWindow {
  float64Array: Float64Array = new Float64Array();
  float32Array: Float32Array = new Float32Array();
  int32Array: Int32Array = new Int32Array();
  uint32Array: Uint32Array = new Uint32Array();
  int16Array: Int16Array = new Int16Array();
  uint16Array: Uint16Array = new Uint16Array();
  int8Array: Int8Array = new Int8Array();
  uint8Array: Uint8Array = new Uint8Array();
  mozBlobBuilder: number = 0;
  webKitBlobBuilder: number = 0;
  blobBuilder: number = 0;
  requestFileSystem: number = 0;
  webkitRequestFileSystem: number = 0;
  indexedDB: number = 0;
  webkitIndexedDB: number = 0;
  mozIndexedDB: number = 0;
  dump: string = '';
  method: string = '';
  persistent: string = '';
  idbTransaction: string | null = null;
  webkitIDBTransaction: null = null;
  idbKeyRange: string | null = null;
  webkitIDBKeyRange: string | null = null;
  document: MandreelDocument = new MandreelDocument();
  localStorage: GetItemArr | null = null;
}
let mandreelWindow = new MandreelWindow();
class GetItemArr {
  getItem(fun: string | null): string | null {
    return fun;
  }
  removeItem(fun: string): void {}
  setItem(key: string, value: string): void {}
}

export { MandreelWindow, mandreelWindow, GetItemArr };
